<template>
	<view>
		<navbar :name="name"></navbar>
		<view style="padding: 30upx;">
			<u-parse :html="resdata.content"></u-parse>
		</view>
	</view>
</template>

<script>
	
import uParse from "@/uview-ui/components/u-parse/u-parse.vue"

	export default {
		components: {
			uParse,
		},
		data() {
			return {
				resdata:'',
				name: '用户服务协议',
				nodes: '<div style="text-align:center;"><img src="https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/d8590190-4f28-11eb-b680-7980c8a877b8.png"/></div>'
			}
		},
		onLoad(e) {
			if (e.name) {
				this.name = e.name;
			}
			this.serviceAgreement(e.name =='用户服务协议'?1:2)
		},
		methods: {
			serviceAgreement(type) {
				let _this = this;
				this.$api.get(global.apiUrls.serviceAgreement, {})
					.then(res => {
						if (res.data.code == 1000) {
							let result = res.data.result,
							resdata = '';
							for(let i = 0;i<result.length;i++){
								if(result[i].type== type){
									resdata = result[i]
								}
							}
							_this.resdata = resdata
						}
					}).catch(err => {})
			}
		}
	}
</script>

<style>
</style>
